<?php
	require_once dirname(__FILE__) . '/../../utils/Utils.php';
  //引入公共参数
  $constant = include(dirname(__FILE__) . '/../../AppletConstant.php');
	/**
	 * 获取accessToken和openId
	 *
	 */

	//调用地址
	$url = "https://open.95516.com/open/access/1.0/token";

	//拼装参数
	$params 	=	array();
	$params["appId"] 			=	$constant['appId'];
	$params["backendToken"] 	=	$constant['backendToken'];
	$params["code"] 			=	$constant['code'];

	//接入方直接填写常量字符串authorization_code
	$params["grantType"] 			=	"authorization_code";

	//发送请求

	$utils =	new Utils();
	$resultStr 	=	$utils->sendPostGson($url,$params);
	header("Content-type: text/html; charset=utf-8");
	print_r("-------获取accessToken和openId: ".$resultStr." --------- ");
    exit();
?>